<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>

<title>密码修改</title>
<link
	href="${pageContext.request.contextPath}/style/css/bootstrap.min.css"
	rel="stylesheet">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/style/css/amazeui.min.css">
</head>

<body>
	<div>
		<form class="am-form-set am-form-horizontal" action="repass" method="post"
			onsubmit="return cpass();">
			<label style="position: absolute;top: 5px;left:10px" for="username">用户名</label>
			<div id="userdiv" class=" am-form-icon"
				style="position: relative;top: 5px;left:100px; width:50%">
				<i class="am-icon-user"></i> <input type="text"
					class="am-form-field " name="username" disabled="disabled"
					id="username" value="${user.userName }">
			</div>
			<label style="position: absolute;top:50px;left:10px"
				for="password">密码</label>
			<div id="passdiv"
				style="position: absolute;top:50px;left:100px;width:50%"
				class="am-form-group am-form-icon">
				<i class="am-icon-key"></i> <input type="password"
					class="am-form-field" name="repassword" id="password" >
			</div>


			<label style="position: absolute;top:100px;left:15px"
				for="repassword">确认密码</label>
			<div id="repassdiv"
				style="position: absolute;top:100px;left:100px;width:50%"
				class="am-form-group am-form-icon">
				<i class="am-icon-lock"></i> <input type="password"
					class="am-form-field" name="repassword1" id="repassword"
					onblur="repass();">
			</div>
			<label id="errorpass" style="position:absolute;top:140px;left:80px;color:red;font-size:15px;font-weight:520;font-family: STXihei,'Microsoft YaHei';">两次输入密码不一致</label>
			<label id="nopass" style="position:absolute;top:140px;left:80px;color:red;font-size:15px;font-weight:520;font-family: STXihei,'Microsoft YaHei';">请输入密码</label>
			<div style="position:absolute;top:170px;left:120px">
				<button type="submit" class="btn btn-primary">确认</button>
			</div>
		</form>
	</div>
</body>
<script src="${pageContext.request.contextPath}/style/js/jquery.min.js"></script>
<script
	src="${pageContext.request.contextPath}/style/js/bootstrap.min.js"></script>

<script src="${pageContext.request.contextPath}/style/js/amazeui.min.js"></script>
<script type="text/javascript">
	$(document).ready(function(){
		$("#errorpass").hide();$("#nopass").hide();
	});
	function repass() {
		var pass = $("#password").val();
		var repass = $("#repassword").val();
		if (""==pass || ""==repass) {
			$("#nopass").show();
			$("#errorpass").hide();
			$("#passdiv").removeClass("am-form-success").addClass(
					"am-form-error");
			$("#repassdiv").removeClass("am-form-success").addClass(
					"am-form-error");
		}else if (pass == repass) {
			$("#errorpass").hide();$("#nopass").hide();
			$("#passdiv").removeClass("am-form-error").addClass(
					"am-form-success");
			$("#repassdiv").removeClass("am-form-error").addClass(
					"am-form-success");
			
		} else {
		$("#nopass").hide();
			$("#errorpass").show();
			$("#passdiv").removeClass("am-form-success").addClass(
					"am-form-error");
			$("#repassdiv").removeClass("am-form-success").addClass(
					"am-form-error");
		}
	}

	function cpass() {
		repass();
		if($("#errorpass").is(":visible")||$("#nopass").is(":visible")){
			return false;
		}
		return true;
	
	}
</script>
</html>
